package 原型模式.demo;

/**
 * @author zyl
 * @Description: 原型类
 * @since 2024/1/3 15:43
 */

public class Prototype implements Cloneable{
    private String id;

    public Prototype(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Object clone(){
        Object object = null;
        try {
            object = super.clone();
        }catch (CloneNotSupportedException e){
            System.out.println("克隆异常," + e.toString());
        }
        return object;
    }
}
